

export const ORDER_STATUS = {
    ALL: '',
    PENDING: 'pending',
    PAID: 'paid',
    // 已确认（已发货）
    SHIPPED: 'shipped',
    COMPLETED: 'completed',
    CANCELLED: 'cancelled',
    REFUNDING: 'refunding',
    REFUNDED: 'refunded',
    REFUND_FAILED: 'refund_failed',
}
// 订单状态图标
export const ORDER_STATUS_ICON = {
    [ORDER_STATUS.PENDING]: '/static/icon/pending.png',
    [ORDER_STATUS.PAID]: '/static/icon/success.png',
    [ORDER_STATUS.REFUNDING]: '/static/icon/refunding.png',
    [ORDER_STATUS.SHIPPED]: '/static/icon/shipped.png',
    [ORDER_STATUS.PENDING_VERIFICATION]: '/static/icon/shipped.png',
    [ORDER_STATUS.REFUNDED]: '/static/icon/refunded.png',
    [ORDER_STATUS.COMPLETED]: '/static/icon/completed.png',
    [ORDER_STATUS.CANCELLED]: '/static/icon/cancelled.png',
    [ORDER_STATUS.PENDING_RECEIPT]: '/static/icon/pending_receipt.png'
}
// 订单状态文本
export const ORDER_STATUS_TEXT = {
    [ORDER_STATUS.PENDING]: '待支付',
    [ORDER_STATUS.PAID]: '已支付',
    [ORDER_STATUS.REFUNDING]: '退款中',
    [ORDER_STATUS.SHIPPED]: '已发货',
    [ORDER_STATUS.PENDING_VERIFICATION]: '待核销',
    [ORDER_STATUS.REFUNDED]: '已退款',
    [ORDER_STATUS.COMPLETED]: '已完成',
    [ORDER_STATUS.CANCELLED]: '已取消',
    [ORDER_STATUS.PENDING_RECEIPT]: '待收货'
}


/**
 * 余额明细类型   `type` tinyint(4) NOT NULL COMMENT '1 提现 2 佣金收入 3 订单抵扣 4 订单抵扣退回',
 */
export const BalanceLogTypeEnum = {
    WITHDRAW: 1, // 提现
    DISTRIBUTOR_INCOME: 2, // 佣金收入，正数收入、负数退款
    ORDER_DEDUCTION: 3, // 订单抵扣
    ORDER_DEDUCTION_REFUND: 4, // 订单抵扣退回
    // 充值
    RECHARGE: 5,
    // 订单代付
    DISTRIBUTOR_CONSUME: 6, // 分销订单消费
    DISTRIBUTOR_CONSUME_REFUND: 7, // 分销订单消费退回

    // 后台充值
    ADMIN_RECHARGE: 8,
    // 提现手续费
    WITHDRAW_FEE: 9,
}

export const BalanceLogTypeTextEnum = {
    [BalanceLogTypeEnum.WITHDRAW]: '佣金提现',
    [BalanceLogTypeEnum.DISTRIBUTOR_INCOME]: '佣金收入',
    [BalanceLogTypeEnum.ORDER_DEDUCTION]: '订单抵扣',
    [BalanceLogTypeEnum.ORDER_DEDUCTION_REFUND]: '订单抵扣退回',
    [BalanceLogTypeEnum.RECHARGE]: '充值',
    [BalanceLogTypeEnum.DISTRIBUTOR_CONSUME]: '订单代付',
    [BalanceLogTypeEnum.DISTRIBUTOR_CONSUME_REFUND]: '订单代付退回',
    [BalanceLogTypeEnum.ADMIN_RECHARGE]: '后台充值',
    [BalanceLogTypeEnum.WITHDRAW_FEE]: '佣金提现手续费',
}

// 文本
export const TRAVEL_ORDER_STATUS_TEXT = {
    [ORDER_STATUS.ALL]: '全部',
    [ORDER_STATUS.PENDING]: '待付款',
    [ORDER_STATUS.PAID]: '已付款',
    [ORDER_STATUS.SHIPPED]: '已确认',
    [ORDER_STATUS.COMPLETED]: '已完成',
    [ORDER_STATUS.CANCELLED]: '已取消',
    [ORDER_STATUS.REFUNDING]: '退款中',
    [ORDER_STATUS.REFUNDED]: '已退款',
    [ORDER_STATUS.REFUND_FAILED]: '退款失败',
}
// 选项列表
export const TRAVEL_ORDER_STATUS_OPTIONS = [
    {
        name: '全部',
        status: ORDER_STATUS.ALL,
        key: 'status'
    },
    {
        name: '待付款',
        status: ORDER_STATUS.PENDING,
        key: 'status'
    },
    {
        name: '待确认',
        status: ORDER_STATUS.PAID,
        key: 'status'
    },
    {
        name: '已确认',
        status: ORDER_STATUS.SHIPPED,
        key: 'status'
    },
    {
        name: '已完成',
        status: ORDER_STATUS.COMPLETED,
        key: 'status'
    },
    {
        name: '已取消',
        status: ORDER_STATUS.CANCELLED,
        key: 'status'
    },
    {
        name: '售后/退款',
        status: 9,
        key: 'refund_status'
    },
]

export const ORDER_STATUS_CLASS = {
    [ORDER_STATUS.PENDING]: 'status-pending',
    [ORDER_STATUS.PAID]: 'status-paid',
    [ORDER_STATUS.SHIPPED]: 'status-shipped',
    [ORDER_STATUS.COMPLETED]: 'status-completed',
    [ORDER_STATUS.REFUNDING]: 'status-refunding',
    [ORDER_STATUS.REFUNDED]: 'status-refunded',
    [ORDER_STATUS.REFUND_FAILED]: 'status-refund-failed',
    [ORDER_STATUS.CANCELLED]: 'status-cancelled',
}

/**
 * 退款状态枚举
 */
export const REFUND_STATUS = {
    // 默认值
    DEFAULT: -1,
    // 待处理
    PENDING: 1,
    // 退款中
    REFUNDING: 2,
    // 退款成功
    SUCCESS: 3,
    // 退款失败
    FAILED: 0,
};
export const REFUND_STATUS_TEXT = {
    [REFUND_STATUS.DEFAULT]: '全部',
    [REFUND_STATUS.PENDING]: '退款中',
    [REFUND_STATUS.REFUNDING]: '退款中',
    [REFUND_STATUS.SUCCESS]: '退款成功',
    [REFUND_STATUS.FAILED]: '退款失败',
}
export const REFUND_STATUS_CLASS = {
    [REFUND_STATUS.PENDING]: 'status-pending',
    [REFUND_STATUS.REFUNDING]: 'status-refunding',
    [REFUND_STATUS.SUCCESS]: 'status-refunded',
    [REFUND_STATUS.FAILED]: 'status-refund-failed',
}